﻿using OnDash.Windowing.Common.Inputs.Enums;

namespace OnDash.Windowing.Common.Inputs;

public sealed class MouseCursor : Image
{
    private MouseCursor(StandardShape shape)
    {
        Shape = shape;
    }

    public MouseCursor(int hotX, int hotY, int width, int height, byte[] data)
        : base(width, height, data)
    {
        if (hotX < 0 || hotX >= Width || hotY < 0 || hotY >= Height)
        {
            throw new ArgumentOutOfRangeException();
        }

        X = hotX;
        Y = hotY;
    }

    public StandardShape Shape { get; }
    public int X { get; }
    public int Y { get; }

    public static MouseCursor Default { get; } = new(StandardShape.Arrow);
    public static MouseCursor IBeam { get; } = new(StandardShape.IBeam);
    public static MouseCursor Crosshair { get; } = new(StandardShape.Crosshair);
    public static MouseCursor Hand { get; } = new(StandardShape.Hand);
    public static MouseCursor VResize { get; } = new(StandardShape.VResize);
    public static MouseCursor HResize { get; } = new(StandardShape.HResize);
    public static MouseCursor Empty { get; } = new(0, 0, 16, 16, new byte[16 * 16 * 4]);
}